<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/23
 * Time: 15:56
 */

namespace app\api\model;


class Gold extends BaseModel
{
    //记录金币日志
    public static function add($title,$user_id,$task_id,$amount)
    {
        $task_no = Task::getValue(['id'=>$task_id],'number');
        $data = [
            'title' => $title,
            'user_id' => $user_id,
//            'task_id' => $task_id,
            'task_no' => $task_no,
            'amount' => $amount,
            'add_time' => time(),
        ];
        $res = self::create($data);
        return $res;
    }
}